<!doctype html>
<html class="no-js">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <title>我的项目</title>
    <!-- Set render engine for 360 browser -->
    <meta name="renderer" content="webkit">
    <!-- No Baidu Siteapp-->
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!-- Add to homescreen for Chrome on Android -->
    <meta name="mobile-web-app-capable" content="yes">
    <link rel="stylesheet" href="css/amazeui.min.css">
    <link rel="stylesheet" href="css/app.css">
    <link rel="stylesheet" href="css/public2.css">
    <style type="text/css">
    button {
        width: 5.46rem;
        height: 0.86rem;
        margin: 0 auto;
        position: relative;
        background: #3D88DD;
        display: block;
        color: white;
        font-size: 0.3rem;
        border-radius: 0.2rem;
        box-shadow: 0px 2px 4px 1px #4994e7bd;
        border: none;
        margin-top: 0.58rem;
    }

    .project {
        width: 6.54rem;
        margin: 0 auto;
        text-align: center;
        box-shadow: 1px 1px 9px 0px #cacaca;
    }

    .project img {

        width: 1.4rem;
    }

    .project_name {
        font-size: 0.35rem;
        display: block;
    }

    .project_admin {
        font-size: 0.25rem;
        display: block;
    }

    .my_project {
        width: 4.9rem;
        height: 0.72rem;
        font-size: 0.42rem;
        margin: 0.44rem auto 5.8rem;
        text-align: center;
        box-shadow: 1px 1px 9px 0px #cacaca;
    }
    </style>
</head>

<body>
    <div class="content">
        <div class="project">
            <img src="images/project_icon.jpg">
            <div style="display: inline-block;">
                <span class="project_name"></span>
                <span class="project_admin"></span>
            </div>
        </div>
        <a href="javascript:;" style="color: #696969;text-decoration: none;">
            <div class="my_project">我的项目</div>
        </a>
        <button class="logout">退出登录</button>
    </div>
    <div class="footer">
        <a href="javacript:;" class="first-page">
            <div class="am-u-sm-4"><img src="images/index_footer.png"><span>首页</span></div>
        </a>
        <a href="javacript:;" class="message">
            <div class="am-u-sm-4"><img src="images/message_footer.png"><span>消息</span></div>
        </a>
        <a href="javacript:;" class="mine">
        <div class="am-u-sm-4"><img src="images/my_active.png"><span>我的</span></div></a>
    </div>
    <script type="text/javascript" src="js/public.js"></script>
    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
    <script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
    <script src="js/amazeui.min.js"></script>
    <script src="js/jquery.min.js"></script>
    <script type="application/javascript">
        function getQueryString(name) {

            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return unescape(r[2]); return null;
        }
        var oAccessToken = getQueryString('access-token');
        $('.message').attr('href','./message.html?access-token='+oAccessToken)
        $('.mine').attr('href','./my.html?access-token='+oAccessToken)
        $('.first-page').attr('href','./main.html?access-token='+oAccessToken)
        $('.logout').click(function(){
            window.location.href = './index.html';
        })
        $('.my_project').click(function(){
            window.location.href = './my_project.html?access-token='+oAccessToken;
        });

        $.ajax({
            url:"/v1/goods/mine?access-token="+oAccessToken,
            type:'post',
            data:'',
            async:true,
            success:function(data){
                if(data.status == 200){
                    console.log(data.body)
                    $('.project_name').text('所属项目:'+data.body.project_name);
                    $('.project_admin').text('负责人:'+data.body.leader);
                }
            },
            error:function(data){
                if(data.status == 401){
                    window.location.href = './index.html';
                }
            },
        });
    </script>
</body>

</html>